x86/hvm: remove HVMIO_dispatched I/O state
authorPaul Durrant <paul.durrant@citrix.com>
Thu, 9 Jul 2015 17:03:00 +0000 (19:03 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 10 Jul 2015 08:18:55 +0000 (10:18 +0200)
commit8ac5da305f0f05c2fbb6a350814e6d772857fed3
treedee19c8fb6c0924a1db302cba99694730bfe6e44
parentfd6b3bdd2337c5f93f932ea6868c4f1c8e9eb77b
x86/hvm: remove HVMIO_dispatched I/O state

By removing the HVMIO_dispatched state and making all pending emulations
(i.e. all those not handled by the hypervisor) use HVMIO_awating_completion,
various code-paths can be simplified.

The completion case for HVMIO_dispatched can also be trivally removed
from hvmemul_do_io() as it was already unreachable. This is because that
state was only ever used for writes or I/O to/from a guest page and
hvmemul_do_io() is never called to complete such I/O.

NOTE: There is one sublety in handle_pio()... The only case when
      handle_pio() got a return code of X86EMUL_RETRY back from
      hvmemul_do_pio_buffer() and found io_state was not
      HVMIO_awaiting_completion was in the case where the domain is
      shutting down. This is because all writes normally yield a return
      of HVMEMUL_OKAY and all reads put io_state into
      HVMIO_awaiting_completion. Hence the io_state check there is
      replaced with a check of the is_shutting_down flag on the domain.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/hvm/emulate.c
xen/arch/x86/hvm/hvm.c
xen/arch/x86/hvm/io.c
xen/arch/x86/hvm/vmx/realmode.c
xen/include/asm-x86/hvm/vcpu.h